#import "Cliente.h"

@implementation Cliente

@synthesize id;
@synthesize razaoSocial;
@synthesize codigoJolitex;
@synthesize vendedorId;

-(NSString*)text {
    return razaoSocial;
}

-(NSDictionary*)toDictionary {
    return @{
             @"id":self.id,
             @"razaoSocial":self.razaoSocial,
             @"codigoJolitex":self.codigoJolitex,
             @"vendedorId":self.vendedorId};
}

+(id<SelectableModel>)fromDictionary:(NSDictionary *)dictionary {
    Cliente* cliente = [[Cliente alloc] init];
    cliente.id = [dictionary objectForKey:@"id"];
    cliente.razaoSocial = [dictionary objectForKey:@"razaoSocial"];
    cliente.codigoJolitex = [dictionary objectForKey:@"codigoJolitex"];
    cliente.vendedorId = [dictionary objectForKey:@"vendedorId"];
    return cliente;
}

@end
